using System;
using System.Xml.XPath;
using System.Collections.Generic;
using System.Text;

using AIFSDataAccessLayer.Utilities;

using AIFSContentManagementSystem.Criteria;

namespace AIFSCMSDataAccessLayer.EntityMappers
{
    /// <summary>
    /// Helper class to Serialize Criteria to/from xml
    /// </summary>
    public sealed class ExpressionElementMapper : EntityMapper<ExpressionElement>
    {
        public ExpressionElementMapper()
        {

        }

        protected override void Map(System.Data.DataRow drEntity, ExpressionElement dto)
        {
            dto.DataType = DataTableUtil.ToStringType(drEntity, "TYPE");
            dto.ExpressionId = DataTableUtil.ToIntType(drEntity, "EXPRESSION_ID");
            dto.CriteriaId = DataTableUtil.ToIntType(drEntity, "CRITERIA_ID");
            dto.LeftOperand = DataTableUtil.ToStringType(drEntity, "LEFT_OPERAND");
            dto.Oper = DataTableUtil.ToStringType(drEntity, "OPER");
            dto.RightOperand = DataTableUtil.ToStringType(drEntity, "RIGHT_OPERAND");
        }
    }
}
